import { defineStore } from 'pinia'
import { computed, ref } from 'vue';


const useBaseStore = defineStore('baseStore',() => {
    const admin = ref(null)
    // const admin = ref({
    //     name: 'admin',
    // })
    const getAdmin = computed(() => admin.value)

    const isLogin = computed(() => admin.value === null ? false : true)
    const logout = () => {
        console.log('sdahidsahiudsa');
		admin.value = null;
		// token.value = ''
		// localStorage.removeItem('token');
	}

    const setAdmin = (a) => {
		admin.value = a;
	}

    return {
		admin,
		getAdmin, isLogin,
		setAdmin, logout,
	}
})


export default useBaseStore